/*
   Copyright (c) 2023 李伟国
   shiro-learner is licensed under Mulan PSL v2.
   You can use this software according to the terms and conditions of the Mulan PSL v2. 
   You may obtain a copy of Mulan PSL v2 at:
            http://license.coscl.org.cn/MulanPSL2 
   THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.  
   See the Mulan PSL v2 for more details. 
*/

package cn.learner.exception;

import cn.learner.constant.enumeration.base.BaseExceptionEnum;
import lombok.Getter;

@Getter
public class AuthException extends RuntimeException{
    private Integer code;
    private String errorMessage;

    public AuthException(){
        super("认证失败！");
        this.code = 500;
        this.errorMessage = "认证失败！";
    }

    public AuthException(BaseExceptionEnum authExceptionEnum){
        super(authExceptionEnum.getMessage());
        this.code = authExceptionEnum.getCode();
        this.errorMessage = authExceptionEnum.getMessage();
    }
}
